package global

import (
	"fmt"
	reg "git.oschina.net/YPTArch/ypt_service_discovery"
	"git.oschina.net/YPTArch/km_api_dispatcher/sys/logs"
)

func Reg() {
	regInfo := reg.RegisterInfo{
		Host:"42.123.127.84",
		Port:Conf.Service.Port,
	}
	api := make(reg.ApiInfo)
	for k,v := range apiList.apiMap{
		api[k] = []string{v.method,v.auth}
	}
	regInfo.Api = api

	_,err := reg.NewRegisterClient([]string{"42.123.126.29:2379"},Conf.Service.Name,regInfo)
	if err != nil{
		logs.Logger.Error(err.Error())
	}
	fmt.Println("\n",regInfo)
}